/*
 * Copyright (c) 2016, Freescale Semiconductor, Inc.
 * Copyright 2016-2019 NXP
 * All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

/*  Standard C Included Files */
#include <stdio.h>
#include <string.h>
#include "pin_mux.h"
#include "board.h"
#include "fsl_debug_console.h"
#include "oled.h"

/*******************************************************************************
 * Definitions
 ******************************************************************************/

uint8_t num = 0;

/*!
 * @brief Main function
 */
int main(void)
{
    /* Attach 12 MHz clock to USART0 (debug console) */
    CLOCK_Select(kUART0_Clk_From_MainClk);
    /* Select the main clock as source clock of I2C0. */
    CLOCK_Select(kI2C1_Clk_From_MainClk);

    BOARD_InitBootPins();
    BOARD_InitBootClocks();
    BOARD_InitDebugConsole();

		OLED.init();
		OLED.clear();
		OLED.showstring(10,0,"Num: ");
		
    PRINTF("\r\nEnd of I2C example .\r\n");
    while (1)
    {
			OLED.shownum(50,0,num++,3);
			for(uint16_t i=0;i<50000;i++)
				__NOP();
    }
}


